package com.yneusoft.manage.model.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


/**
 * @author lt
 * @date 2021/10/22 19:29
 * @description: 登录模块 2.用户登录 参数类
 */
@Data
public class UserLoginParam {

    /**
     * 登录：手机号
     */
    @NotNull(message = "电话号码不能为空")
    @Pattern(regexp ="^\\d{11}$", message = "手机号为11位字符")
    private String phone;

    /**
     * 登录：密码
     */
    @NotNull(message = "密码不能为空")
    @Pattern(regexp ="^(?=.*\\d)(?=.*[a-zA-Z]).{6,20}$", message = "密码格式错误")
    private String password;

    /**
     * 登录：验证码
     */
    @NotNull(message = "验证码不能为空")
    @Length(max = 4,message = "验证码最多4位")
    //@Pattern(regexp ="^.{4}$", message = "验证码格式错误")
    private String imageCode;

    /**
     * 验证码密钥
     */
    @NotNull(message = "验证码密钥不能为空")
    private String imageCodeKey;
}
